3.454 \(\int \frac{(c \cos (e+f x))^m (A+B \cos (e+f x))}{a+b \cos (e+f x)} \, dx\)

Optimal. Leaf size=286 \[ \frac{a c (A b-a B) \sin (e+f x) \cos ^2(e+f x)^{\frac{1-m}{2}} (c \cos (e+f x))^{m-1} F_1\left (\frac{1}{2};\frac{1-m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{b f \left (a^2-b^2\right )}-\frac{(A b-a B) \sin (e+f x) \cos ^2(e+f x)^{-m/2} (c \cos (e+f x))^m F_1\left (\frac{1}{2};-\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )}-\frac{B \sin (e+f x) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(e+f x)\right )}{b c f (m+1) \sqrt{\sin ^2(e+f x)}} \]

[Out]

(a*(A*b - a*B)*c*AppellF1[1/2, (1 - m)/2, 1, 3/2, Sin[e + f*x]^2, -((b^2*Sin[e + f*x]^2)/(a^2 - b^2))]*(c*Cos[
e + f*x])^(-1 + m)*(Cos[e + f*x]^2)^((1 - m)/2)*Sin[e + f*x])/(b*(a^2 - b^2)*f) - ((A*b - a*B)*AppellF1[1/2, -
m/2, 1, 3/2, Sin[e + f*x]^2, -((b^2*Sin[e + f*x]^2)/(a^2 - b^2))]*(c*Cos[e + f*x])^m*Sin[e + f*x])/((a^2 - b^2
)*f*(Cos[e + f*x]^2)^(m/2)) - (B*(c*Cos[e + f*x])^(1 + m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e +
 f*x]^2]*Sin[e + f*x])/(b*c*f*(1 + m)*Sqrt[Sin[e + f*x]^2])

________________________________________________________________________________________

Rubi [A]  time = 0.412338, antiderivative size = 286, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.152, Rules used = {3002, 2643, 2823, 3189, 429} \[ \frac{a c (A b-a B) \sin (e+f x) \cos ^2(e+f x)^{\frac{1-m}{2}} (c \cos (e+f x))^{m-1} F_1\left (\frac{1}{2};\frac{1-m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{b f \left (a^2-b^2\right )}-\frac{(A b-a B) \sin (e+f x) \cos ^2(e+f x)^{-m/2} (c \cos (e+f x))^m F_1\left (\frac{1}{2};-\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )}-\frac{B \sin (e+f x) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(e+f x)\right )}{b c f (m+1) \sqrt{\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Int[((c*Cos[e + f*x])^m*(A + B*Cos[e + f*x]))/(a + b*Cos[e + f*x]),x]

[Out]

(a*(A*b - a*B)*c*AppellF1[1/2, (1 - m)/2, 1, 3/2, Sin[e + f*x]^2, -((b^2*Sin[e + f*x]^2)/(a^2 - b^2))]*(c*Cos[
e + f*x])^(-1 + m)*(Cos[e + f*x]^2)^((1 - m)/2)*Sin[e + f*x])/(b*(a^2 - b^2)*f) - ((A*b - a*B)*AppellF1[1/2, -
m/2, 1, 3/2, Sin[e + f*x]^2, -((b^2*Sin[e + f*x]^2)/(a^2 - b^2))]*(c*Cos[e + f*x])^m*Sin[e + f*x])/((a^2 - b^2
)*f*(Cos[e + f*x]^2)^(m/2)) - (B*(c*Cos[e + f*x])^(1 + m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e +
 f*x]^2]*Sin[e + f*x])/(b*c*f*(1 + m)*Sqrt[Sin[e + f*x]^2])

Rule 3002

Int[(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]))/((c_.) + (d_.)*sin[
(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[B/d, Int[(a + b*Sin[e + f*x])^m, x], x] - Dist[(B*c - A*d)/d, Int[(a +
 b*Sin[e + f*x])^m/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
&& NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2823

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[a, Int[(d*
Sin[e + f*x])^n/(a^2 - b^2*Sin[e + f*x]^2), x], x] - Dist[b/d, Int[(d*Sin[e + f*x])^(n + 1)/(a^2 - b^2*Sin[e +
 f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && NeQ[a^2 - b^2, 0]

Rule 3189

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff
 = FreeFactors[Cos[e + f*x], x]}, -Dist[(ff*d^(2*IntPart[(m - 1)/2] + 1)*(d*Sin[e + f*x])^(2*FracPart[(m - 1)/
2]))/(f*(Sin[e + f*x]^2)^FracPart[(m - 1)/2]), Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x]
, x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] &&  !IntegerQ[m]

Rule 429

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, -((b*x^n)/a), -((d*x^n)/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rubi steps

\begin{align*} \int \frac{(c \cos (e+f x))^m (A+B \cos (e+f x))}{a+b \cos (e+f x)} \, dx &=\frac{B \int (c \cos (e+f x))^m \, dx}{b}-\frac{(-A b+a B) \int \frac{(c \cos (e+f x))^m}{a+b \cos (e+f x)} \, dx}{b}\\ &=-\frac{B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac{1}{2},\frac{1+m}{2};\frac{3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt{\sin ^2(e+f x)}}+\frac{(a (A b-a B)) \int \frac{(c \cos (e+f x))^m}{a^2-b^2 \cos ^2(e+f x)} \, dx}{b}-\frac{(A b-a B) \int \frac{(c \cos (e+f x))^{1+m}}{a^2-b^2 \cos ^2(e+f x)} \, dx}{c}\\ &=-\frac{B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac{1}{2},\frac{1+m}{2};\frac{3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt{\sin ^2(e+f x)}}+\frac{\left (a (A b-a B) c (c \cos (e+f x))^{2 \left (-\frac{1}{2}+\frac{m}{2}\right )} \cos ^2(e+f x)^{\frac{1}{2}-\frac{m}{2}}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (-1+m)}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{b f}-\frac{\left ((A b-a B) (c \cos (e+f x))^m \cos ^2(e+f x)^{-m/2}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{m/2}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a (A b-a B) c F_1\left (\frac{1}{2};\frac{1-m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^{-1+m} \cos ^2(e+f x)^{\frac{1-m}{2}} \sin (e+f x)}{b \left (a^2-b^2\right ) f}-\frac{(A b-a B) F_1\left (\frac{1}{2};-\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^m \cos ^2(e+f x)^{-m/2} \sin (e+f x)}{\left (a^2-b^2\right ) f}-\frac{B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac{1}{2},\frac{1+m}{2};\frac{3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt{\sin ^2(e+f x)}}\\ \end{align*}

Mathematica [B]  time = 27.0578, size = 10482, normalized size = 36.65 \[ \text{Result too large to show} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[((c*Cos[e + f*x])^m*(A + B*Cos[e + f*x]))/(a + b*Cos[e + f*x]),x]

[Out]

Result too large to show

________________________________________________________________________________________

Maple [F]  time = 1.145, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( c\cos \left ( fx+e \right ) \right ) ^{m} \left ( A+B\cos \left ( fx+e \right ) \right ) }{a+b\cos \left ( fx+e \right ) }}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*cos(f*x+e))^m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x)

[Out]

int((c*cos(f*x+e))^m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \cos \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x, algorithm="maxima")

[Out]

integrate((B*cos(f*x + e) + A)*(c*cos(f*x + e))^m/(b*cos(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \cos \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x, algorithm="fricas")

[Out]

integral((B*cos(f*x + e) + A)*(c*cos(f*x + e))^m/(b*cos(f*x + e) + a), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))**m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \cos \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(A+B*cos(f*x+e))/(a+b*cos(f*x+e)),x, algorithm="giac")

[Out]

integrate((B*cos(f*x + e) + A)*(c*cos(f*x + e))^m/(b*cos(f*x + e) + a), x)